#include <thread>
#include <boost/asio.hpp>
#include <iostream>
#include <thread>
#include <boost/beast/http.hpp>

//boost::asio::io_context
int test(int argc, char const *argv[])
{
    boost::asio::io_context io;
    boost::asio::io_context::work work(io); 
    std::cout<<std::this_thread::get_id()<<std::endl;
    std::thread thd([&io](){ while (true)
    {
        std::cout<<std::this_thread::get_id()<<std::endl;
        std::string str;
        std::cin>>str;
        io.post([](){std::cout<<"hello"<<std::endl;});
        boost::asio::post(boost::asio::strand<boost::asio::io_context::executor_type>(io.get_executor()),[](){std::cout<<"hello"<<std::endl;});
    }});
    io.run();
    thd.join();
    return 0;
}
int main(int argc, char const *argv[])
{
    
    boost::asio::io_context io;
    //地址解析
    boost::asio::ip::tcp::resolver::query a("bilibili.com","https");
    boost::asio::ip::tcp::resolver resolver(io);
    boost::asio::ip::tcp::resolver::iterator it= resolver.resolve(a);
    
    boost::asio::ip::tcp::socket socket (io);
    
    


    return 0;
}
